package edu.hawaii.duedates.wicket;

import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.PasswordTextField;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.PropertyModel;

/**
 * The home page for this Stack application.
 * 
 * @author Erin Kim
 */
public class Index extends DueDatesPage {
  private static final long serialVersionUID = 1L;
  String field1;
  String field2;

  /**
   * Creates a new home page. It contains A visual interface of a stack object. Options to push,
   * pop, and clear are presented through forms.
   */
  public Index() {

    Form loginForm = new Form("login");

    loginForm.add(new TextField("username", new PropertyModel(this, "field1")).setRequired(true));
    loginForm.add(new PasswordTextField("password", new PropertyModel(this, "field2"))
        .setRequired(true));
    loginForm.add(new Button("submit") {
      private static final long serialVersionUID = 1L;

      @Override
      public void onSubmit() {
        setResponsePage(DueDatesList.class);
      }
    });

    add(loginForm);
    // add(popForm);
    // add(clearForm);
    // add(new Label("Stack", getStack().toString()));
  }

}
